<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<jsp:include page="../../common/jsp/taglibs.jsp"/>
<html>
<head>
    <META charset="utf-8">
    <META name="viewport" content="initial-scale=1.0, maximum-scale=2.0">
    <META name="renderer" content="webkit">
    <META http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>新增/修改生产信息</title>
    <jsp:include page="../../common/jsp/head.jsp"/>
    <link href="${ctx}css/public.css" rel="stylesheet" type="text/css"/>
    <link type="text/css" href="${ctx}plugins/ztree/zTreeStyle/zTreeStyle.css?version=${version}" rel="stylesheet"/>
    <style>
        .content_wrap {
            position: absolute;
            z-index: 1;
            background: #fff;
            border: 1px solid #ccc;
        }
    </style>
</head>
<body>
<input id="type" type="hidden" value='${type}'/>
<input id="pId" type="hidden" value='<s:property value="production.id"/>'>
<input id="dictValueTemp" type="hidden" value='<s:property value="production.productType"/>'>
<form class="layui-form">
    <table class="layui-table">
        <tr>
            <td>
                <div class="layui-form-item">
                    <label class="layui-form-label">生产批次</label>
                    <div class="layui-input-inline">
                        <s:if test="production.batch!=null">
                            <input id="batch" type="text" disabled class="layui-input"
                                   value='<s:property value="production.batch" />' style="border-style:none">
                        </s:if>
                        <s:else>
                            <input type="text" class="layui-input" placeholder="自动生成" disabled style="border-style:none">
                        </s:else>
                    </div>
                </div>
            </td>
            <td>
                <div class="layui-form-item">
                    <label class="layui-form-label"><em>*</em>产品类型</label>
                    <div class="layui-input-inline">
                        <select id="dictType" lay-verify="verifyType" <s:if test="type=='update'">disabled</s:if>>
                            <option value="">请选择类型</option>
                        </select>
                    </div>
                </div>
            </td>
        </tr>
        <tr>
            <td>
                <div class="layui-form-item">
                    <label class="layui-form-label"><em>*</em>开始时间</label>
                    <div class="layui-input-inline">
                        <input id="startTime" class="laydate-icon" placeholder="请选择开始时间" lay-verify="verifyStartTime2"
                               onclick="layui.laydate({elem: this, istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
                               maxlength="19" value='<s:property value="production.startTime"/>' style="width:240px;">
                    </div>
                </div>
            </td>
            <td>
                <div class="layui-form-item">
                    <label class="layui-form-label"><em>*</em>生产数量</label>
                    <div class="layui-input-inline">
                        <input id="number" type="text" lay-verify="verifyNumber" placeholder="请输入生产数量"
                               class="layui-input" size="3" maxlength="3"
                               value='<s:property value="production.number"/>'
                               onkeyup="this.value=this.value.replace(/\D/g,'')"
                               onafterpaste="this.value=this.value.replace(/\D/g,'')"
                               <s:if test="type=='update'">disabled</s:if>>
                    </div>
                </div>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <div class="layui-form-item">
                    <label class="layui-form-label"><em>*</em>负责人</label>
                    <input id="userId" type="hidden" value='<s:property value="production.chargeId"/>'/>
                    <div id="treeContent" class="layui-input-inline" style="width:67%;">
                        <input id="userSel" lay-verify="verifyCharge" type="text" readonly placeholder="请选择负责人"
                               class="layui-input layui-input layui-unselect">
                        <i class="layui-icon" style="position: absolute;top:9px;right:10px;">&#xe612;</i>
                        <a onclick="clearUser();" class="layui-btn layui-btn-danger btn-default layui-btn-small"
                           style="position: absolute;top:4px;right:-80px;"><i class="layui-icon">
                            &#xe640;</i>清除</a>
                        <div id="menuContent" class="zTreeDemoBackground left content_wrap">
                            <ul id="userTree" class="ztree"></ul>
                        </div>
                    </div>
                </div>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">备注</label>
                    <div class="layui-input-block" style="width: 78%">
                        <textarea id="remark" class="layui-textarea"
                                  onkeyup="if(this.value.length>150) this.value=this.value.substr(0,150)"><s:property
                                value="production.remark"/></textarea>
                    </div>
                </div>
            </td>
        </tr>
    </table>
    <div class="layui-form-item">
        <div class="layui-input-inline" style="float:right;margin-top:25px;">
            <a style="float: right;" class="layui-btn layui-btn-primary close">取消</a>
            <a id="submit" style="float: right; margin-right: 15px;" class="layui-btn" lay-submit
               lay-filter="submit">提交</a>
        </div>
    </div>
</form>
</body>
</html>
<script type="text/javascript" src="${ctx}plugins/ztree/jquery.ztree.all-3.5.min.js?version=${version}"></script>
<script type="text/javascript" src="${ctx}js/user/selectUserRadio.js?version=${version}"></script>
<script type="text/javascript" src="${ctx}common/js/closeAndRefresh.js?version=${version}"></script>
<script type="text/javascript" src="${ctx}js/production/addOrUpdateProduction.js?version=${version}"></script>
<script type="text/javascript" src="${ctx}js/public.js?version=${version}"></script>
